Copy Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Copies at most count items from the collection source to the array dest, starting at the index destIndex. The source collection must not be the destination array or part thereof.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static void Copy<T>(
	IEnumerable<T> source,
	T[] dest,
	int destIndex,
	int count
)
Visual Basic (Declaration)
Public Shared Sub Copy(Of T) ( _
	source As IEnumerable(Of T), _
	dest As T(), _
	destIndex As Integer, _
	count As Integer _
)
Visual C++
public:
generic<typename T>
static void Copy (
	IEnumerable<T>^ source, 
	array<T>^ dest, 
	int destIndex, 
	int count
)

Parameters

source
IEnumerable<(Of <T>)>
The collection that provide the source items.
dest
array<T>[]()
The array to store the items into.
destIndex
Int32
The index to begin copying items to.
count
Int32
The maximum number of items to copy. The array must be large enought to fit this number of items.

Type Parameters

T

Exceptions

ExceptionCondition
System..::ArgumentOutOfRangeExceptiondestIndex is negative or greater than dest.Length.
System..::ArgumentOutOfRangeExceptioncount is negative or destIndex + count is greater than dest.Length.
System..::ArgumentNullExceptionsource or dest is null.

See Also